-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
record transaction fees #10715
record transaction fees #10715
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks pretty good
I'm a little uncertain on a couple things...
zone.subZone('status-manager'), | ||
t.context.txnsNode, | ||
); | ||
const { statusManager } = t.context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statusManager
is not stateless, so sharing it across tests is surprising. Consider adding a comment to say that this is done on purpose and why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's constructed in beforeEach
so it's not shared across tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. beforeEach
. I missed that. cool.
|
||
const capData = await E(marshaller).toCapData(record); | ||
|
||
await E(txNode).setValue(JSON.stringify(capData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why await the setValue?
I'm fuzzy on our void
vs await
conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function has to be async
to get capData
before stringifying it.
this final await
is just to provide the option to the caller to await that part. All the consumers use void
now but voiding here wouldn't change the need for that.
@@ -164,7 +162,7 @@ export const prepareStatusManager = ( | |||
publishEvidence(txHash, evidence); | |||
if (status !== PendingTxStatus.Observed) { | |||
// publishEvidence publishes Observed | |||
publishStatus(txHash, status); | |||
void publishTxnRecord(txHash, harden({ status })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does void
mean "I'm certain this never rejects" or "if it rejects, there's nothing useful I can do, so I might as well let standard unhandled rejection logging do its thing"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the latter
storedCompletedTxs.add(txId); | ||
} | ||
|
||
const capData = await E(marshaller).toCapData(record); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side note: This adds a round-trip to the board vat; I'm curious whether it has a noticeable / measurable performance impact. Here's hoping I/we measure that in...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@@ -40,6 +41,7 @@ export interface CctpTxEvidence { | |||
*/ | |||
export interface TransactionRecord extends CopyRecord { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type could be more precise. It could be a union that requires evidence in OBSERVED and split in DISBURSED.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be. I went this way to maintain the option to include these any time.
f27f72f
to
8846972
Compare
closes: #10578
Description
Adds the fee
split
to the Disbursed status of TransactionRecord.Also updates tests to have a marshaller that is capable of marshaling brands in the split.
Security Considerations
Gives a read-only marshaller to StatusManager.
Scaling Considerations
a little more data recorded on disbursement. Since that's a terminal state it will be retained until the GC action is run in a core-eval (or we are able to delete upon completion)
Documentation Considerations
updated types
Testing Considerations
CI
Upgrade Considerations
not deployed